import { ADD, MINUS, SETADDRESS } from '../constants/counter';

export const add = () => {
  return {
    type: ADD,
  };
};
export const minus = () => {
  return {
    type: MINUS,
  };
};

export const setAddress = (payload) => {
  return {
    type: SETADDRESS,
    payload,
  };
};

// 异步的action
export function asyncAdd() {
  return dispatch => {
    setTimeout(() => {
      dispatch(add());
    }, 2000);
  };
}
